package com.nondo.dean.order.model;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;

import com.nondo.dean.common.tool.BeanUtils;
import com.nondo.dean.order.domain.OrderDetail;

public class OrderDetailBean {
    /**
     * 产品ID
     */
    private Integer productId;
    
    /**
     * 产品编码
     */
    private String productCode;
    
    /**
     * 产品名称
     */
    private String productName;

    /**
     * 产品价格
     */
    private BigDecimal productPrice;

    /**
     * @return the productId
     */
    public Integer getProductId() {
        return productId;
    }

    /**
     * @param productId the productId to set
     */
    public void setProductId(Integer productId) {
        this.productId = productId;
    }

    /**
     * @return the productCode
     */
    public String getProductCode() {
        return productCode;
    }

    /**
     * @param productCode the productCode to set
     */
    public void setProductCode(String productCode) {
        this.productCode = productCode;
    }

    /**
     * @return the productName
     */
    public String getProductName() {
        return productName;
    }

    /**
     * @param productName the productName to set
     */
    public void setProductName(String productName) {
        this.productName = productName;
    }

    /**
     * @return the productPrice
     */
    public BigDecimal getProductPrice() {
        return productPrice;
    }

    /**
     * @param productPrice the productPrice to set
     */
    public void setProductPrice(BigDecimal productPrice) {
        this.productPrice = productPrice;
    }


    public static List<OrderDetailBean> covertToBeanList(List<OrderDetail> orderDetailList) {
        List<OrderDetailBean> orderDetailBeanList = new ArrayList<OrderDetailBean>();
        for (OrderDetail orderDetail : orderDetailList) {
            orderDetailBeanList.add(OrderDetailBean.covertToBean(orderDetail));
        }
        return orderDetailBeanList;
    }

    private static OrderDetailBean covertToBean(OrderDetail orderDetail) {
        OrderDetailBean orderDetailBean = new OrderDetailBean();
        BeanUtils.copy(orderDetail, orderDetailBean);
        return orderDetailBean;
    }

}
